package com.woniuxy.entity.dto;

import com.woniuxy.entity.User;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.beans.BeanUtils;

/**
 * @author dingpf
 * @version 1.0
 * @description
 * @create 2025/4/25 17:19
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class UserDTO {
    private Integer id;
    private String account;
    private String nickName; //别名

    public UserDTO(User user){
        //把PO的属性赋给DTO
        //参数1：PO 参数2：DTO
        BeanUtils.copyProperties(user,this);
    }
}
